﻿<UserControl x:Class="Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ComponentModel.Editors.CustomAttributesEditor"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
    
    <UserControl.Resources>
        <DataTemplate x:Key="KeyValueItem">
            <Grid Focusable="False">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition SharedSizeGroup="KeyCol" Width="160*"/>
                    <ColumnDefinition SharedSizeGroup="ValueCol" Width="160*"/>
                    <ColumnDefinition SharedSizeGroup="DeleteCol" Width="16"/>
                </Grid.ColumnDefinitions>
                <TextBox Grid.Column="0" BorderThickness="0, 0, 1, 1" Text="{Binding Path=Key, UpdateSourceTrigger=PropertyChanged}" />
                <TextBox Grid.Column="1" BorderThickness="0, 0, 0, 1" Text="{Binding Path=Value, UpdateSourceTrigger=PropertyChanged}" />                
                <Button Grid.Column="2" Command="{Binding DeleteCommand}" Style="{DynamicResource DeleteButtonStyle}" Margin="0,0,0,8" VerticalAlignment="Top" Width="7" Height="7" />
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    
    <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" HorizontalAlignment="Stretch">
        <StackPanel Orientation="Vertical">
        <Grid>
            <Grid.ColumnDefinitions>
                    <ColumnDefinition SharedSizeGroup="KeyCol" MinWidth="60" Width="*" />
                    <ColumnDefinition SharedSizeGroup="ValueCol" MinWidth="60" Width="*"/>
                    <ColumnDefinition SharedSizeGroup="DeleteCol" Width="16"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0">Key</TextBlock>
                <TextBlock Grid.Column="1">Value</TextBlock>
        </Grid>
            
        <ItemsControl Focusable="False" x:Name="Items" ItemTemplate="{StaticResource KeyValueItem}">
        </ItemsControl>
        </StackPanel>
    </ScrollViewer>
</UserControl>
